<%-- 
    Document   : accountManagement
    Created on : Nov 4, 2012, 6:46:40 AM
    Author     : msc
--%>

<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Account Management</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="../style/adminStyle.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../js/cufon-yui.js"></script>
        <script type="text/javascript" src="../js/arial.js"></script>
        <script type="text/javascript" src="../js/cuf_run.js"></script>
        <script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="../js/radius.js"></script>
    </head>
    <body>
        <input type="hidden" name="pageLocation" value="4" />
        <div class="main">
            <%@include file="../WEB-INF/template/adminHeader.jspf" %>
            <div class="content">
                <%@include file="../WEB-INF/template/adminHorizontalMenu.jspf" %>
                <div class="content_resize">
                    <%@include file="../WEB-INF/template/adminVMAccountManagement.jspf" %>
                    <div class="mainbar">
                        <div class="mainbar_content">
                            <div class="header_bar"><img src="../images/admin/table_48.png" /> Accounts Board</div>
                            <%
                                HttpSession ss = request.getSession();
                                ArrayList<ArrayList> supList = (ArrayList<ArrayList>) ss.getAttribute("listClaim");
                                if (supList != null) {
                            %>
                            <form action="../ListClaim" method="get">
                                <div class="container_filter_box">
                                    <div class="filter_box">
                                        Set Date: From 
                                        <input id="set_date_from" name="set_date_from" type="text" size="8" />
                                        To 
                                        <input id="set_date_to" name="set_date_to" type="text" size="8" />
                                        Status: 
                                        <select name="option_search">
                                            <option value="1">-- Select --</option>
                                            <option value="1">Approved</option>
                                            <option value="2">Processed</option>
                                            <option value="3">Canceled</option>
                                        </select>
                                        <input name="submit" type="submit" value="Filter" />
                                        <%--
                                        <input id="input_search" name="search" type="text" size="25" />
                                        <input name="submit" type="submit" value="Search" />
                                        --%>
                                    </div>
                                </div>
                            </form>
                            <form action="../ListClaim" method="get">
                                <%--<div class="inner-content"> --%>
                                <input type="hidden" name="vSize" id="vSize" value="<%=supList.size()%>" />
                                <table id="table-management-claim" class="table-management">
                                    <tr class="table-row-header">
                                        <th><input id="deleteAll" type="checkbox" name="deleteAll" value="<%=String.valueOf(supList.size())%>" onclick="checkAllDelete()" /></th>
                                        <th>Id</th>
                                        <th>Set Date</th>
                                        <th>Employee</th>
                                        <th>Title</th>
                                        <th>Status</th>
                                        <th>Detail</th>
                                        <th>Delete</th>
                                    </tr>
                                    <%
                                        if (!supList.isEmpty()) {
                                            int location = -1;
                                            for (ArrayList<String> subList : supList) {
                                                ++location;
                                                ArrayList<String> statusArray = new ArrayList<String>();
                                                statusArray.add("");
                                                statusArray.add("");
                                                statusArray.add("");
                                                switch (Integer.valueOf(subList.get(5)).intValue()) {
                                                    case 1: {
                                                        statusArray.set(0, "selected=\"true\"");
                                                    }
                                                    break;
                                                    case 2: {
                                                        statusArray.set(1, "selected=\"true\"");
                                                    }
                                                    break;
                                                    case 3: {
                                                        statusArray.set(2, "selected=\"true\"");
                                                    }
                                                    break;
                                                    default: {
                                                        break;
                                                    }
                                                }
                                    %>
                                    <tr class="table-row-normal">
                                        <td class="table_cell_first"><input id="checkbox_item" name="checkbox_item" type="checkbox" value="<%=subList.get(0)%>" onclick="checkDelete()" /></td>
                                        <td><%=subList.get(0)%><input id="claimItem<%=location%>" type="hidden" name="claimIdItem<%=location%>" value="<%=subList.get(0)%>" /></td>
                                        <td><%=subList.get(1)%></td>
                                        <td><%=subList.get(2)%></td>
                                        <td><%=subList.get(3)%></td>
                                        <td>
                                            <select id="claim_status" name="claim_status">
                                                <option value="1" <%=statusArray.get(0)%> >Approved</option>
                                                <option value="2" <%=statusArray.get(1)%>>Processed</option>
                                                <option value="3" <%=statusArray.get(2)%>>Canceled</option>
                                            </select>
                                        </td>
                                        <%--     <td><input id="statusItem<%="1" + String.valueOf(location)%>" type="radio" name="statusItem<%=String.valueOf(location)%>" value="1" <%=statusArray.get(0)%> onclick="checkItemProcessed()" /></td> --%>
                                        <td><a href="../ListClaim?dt=<%=subList.get(4)%>"><img src="../images/admin/Details.png" alt="Detail" /></a></td>
                                        <td><a href="../ListClaim?dl=<%=subList.get(6)%>"><img src="../images/admin/Delete.png" alt="Delete" /></a></td>
                                    </tr>

                                    <%
                                        }
                                    %>
                                    <tr class="table-row-normal" style="background-color: #f2f2f2;font-weight: bold;">
                                        <td colspan="2">
                                            <span style="color: blue;">All: </span>
                                        </td>
                                        <td colspan="7">
                                            <a href=""><img src="../images/admin/DeleteItems.png" /> Delete</a>
                                            <a href=""><img src="../images/admin/Approved.png" /> Approve</a>
                                            <a href=""><img src="../images/admin/Processed.png" /> Processed</a>
                                            <a href=""><img src="../images/admin/Canceled.png" /> Cancel</a>
                                        </td>
                                    </tr>
                                    <%
                                    } else {
                                    %>
                                    <tr><td><span>The claim table is empty.</span></td></tr>
                                    <%                                            }
                                    %>
                                </table>
                                <div class="container_list_claim_save">
                                    <div class="list_claim_save">
                                        <input type="submit" name="submit" value="Save" />
                                    </div>
                                </div>
                            </form>
                            <%
                            } else {
                                response.sendRedirect("../ListClaim");
                            %>
                            <span>The claim table is not found.</span>
                            <%                                }
                            %>
                        </div>
                    </div>
                    <div class="clr"></div>
                </div>
            </div>
            <%-- <%@include file="WEB-INF/template/userFooterBar.jspf" %> --%>
            <%@include file="../WEB-INF/template/adminFooter.jspf" %>
        </div>
    </body>
</html>
